import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
  path: '/',
  name: 'Home',
  component: Home
}, {
  path: '*',
  name: 'NotFound',
  component: () => import('@/views/NotFound.vue')
}]



const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

router.createRouter = (myroutes) => {
  router.matcher = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    myroutes
  }).matcher
}


export {
  router,
  // routes,
  // createRouter
}